<?php
$route->any('login', 'AuthController@login')->name('admin.user.login');

$route->any('qiniu/callback', 'QiNiuController@callback');

$route->any('test', 'TestController@index');

$route->any('notify', 'TestController@notify');

//type
$route->get('type/index', 'TypeController@index')->name('admin.type.index');

$route->group(['middleware' => 'api.auth'], function ($route) {
    
    //管理员
    $route->get('admin/index', 'AdminController@index')->name('admin.admin.index');
    $route->get('logout', 'AdminController@logout')->name('admin.admin.logout');
    $route->post('admin/store', 'AdminController@store')->name('admin.admin.store');
    $route->post('password/update', 'AdminController@updatePwd')->name('admin.password.update');
    $route->any('permission', 'AuthController@permission');

    //category
    $route->get('category/index', 'CategoryController@index');
    $route->get('category/info', 'CategoryController@info');
    $route->post('category/store', 'CategoryController@store');
    $route->post('category/destroy', 'CategoryController@destroy');

    //cookbook
    $route->get('cookbook/index', 'CookbookController@index');
    $route->get('cookbook/info', 'CookbookController@info');
    $route->post('cookbook/edit/status', 'CookbookController@editStatus');
    $route->post('cookbook/destroy', 'CookbookController@destroy');

    //激励视频
    $route->get('video/daren', 'CookbookAdvViewController@daren_index');
    $route->get('video/click', 'CookbookAdvViewController@click_index');
    $route->any('video/budget/store', 'CookbookAdvViewController@store_budget');
    $route->get('video/budget', 'CookbookAdvViewController@budget_index');

    //食谱集合
    $route->get('collect/index', 'CookbookCollectController@index');
    $route->get('collect/info', 'CookbookCollectController@info');
    $route->post('collect/store', 'CookbookCollectController@store');
    $route->post('collect/destroy', 'CookbookCollectController@destroy');

    //merchant
    $route->get('merchant/index', 'MerchantController@index');
    $route->get('merchant/info', 'MerchantController@info');
    $route->post('merchant/edit/status', 'MerchantController@editStatus');
    $route->any('merchant/child', 'MerchantController@child');

    //会员套餐
    $route->get('package/setting/index', 'PackageSettingController@index');
    $route->get('package/setting/info', 'PackageSettingController@info');
    $route->post('package/setting/store', 'PackageSettingController@store');
    $route->post('package/setting/destroy', 'PackageSettingController@destroy');

    //设置
    $route->get('setting/info', 'ConfigController@info');
    $route->post('setting/store', 'ConfigController@store');

    //site
    $route->get('config/site', 'ConfigController@site')->name('admin.config.site');
    $route->post('config/site/update', 'ConfigController@update')->name('admin.config.site.update');

    //order
    $route->get('order/index', 'OrderController@index');

    //notebook
    $route->get('notebook/index', 'NotebookController@index');
    $route->post('notebook/edit/status', 'NotebookController@editStatus');
    $route->any('notebook/destroy', 'NotebookController@destroy');

    //user
    $route->get('user/index', 'UserController@index');
    $route->post('user/edit/status', 'UserController@editStatus');
    $route->post('user/temp/daren', 'UserController@applyTempDaren');

    //vip order
    $route->get('vip/order', 'VipOrderController@index');

    //提现
    $route->any('withdraw/handle', 'WithdrawController@handle');
    $route->any('withdraw/index', 'WithdrawController@index');
    $route->any('withdraw/query', 'WithdrawController@query');

    #=============================== mall ====================================
    //product
    $route->any('product/index', 'ProductController@index');
    $route->any('product/info', 'ProductController@info');
    $route->any('product/store', 'ProductController@store');
    $route->any('product/destroy', 'ProductController@destroy');
    $route->any('product/edit/status', 'ProductController@editStatus');
    $route->any('product/sale/num/edit', 'ProductController@editSaleNum');

    //specs
    $route->any('specs/index', 'SpecsController@index');
    $route->any('specs/store', 'SpecsController@store');
    $route->any('specs/destroy', 'SpecsController@destroy');

    //满减优惠
    $route->any('reduction/index', 'MallFullReductionController@index');
    $route->any('reduction/store', 'MallFullReductionController@store');
    $route->any('reduction/info', 'MallFullReductionController@info');
    $route->any('reduction/destroy', 'MallFullReductionController@destroy');

    //tags
    $route->any('tag/index', 'TagController@index');
    $route->any('tag/store', 'TagController@store');
    $route->any('tag/destroy', 'TagController@destroy');

    //厂商管理
    $route->any('producer/index', 'ProducerController@index');
    $route->any('producer/store', 'ProducerController@store');
    $route->any('producer/edit/status', 'ProducerController@editStatus');


    //退款
    $route->any('refund/index', 'MallRefundController@index');
    $route->any('refund/info', 'MallRefundController@info');
    $route->any('refund/agree', 'MallRefundController@agree');
    $route->any('refund/refuse', 'MallRefundController@refuse');

    //订单
    $route->any('mall/order/index', 'MallOrderController@index');
    $route->any('mall/order/info', 'MallOrderController@info');
    $route->any('mall/order/express/info', 'MallOrderController@expressInfo');
    //取消订单
    $route->any('mall/order/cancel', 'MallOrderController@cancel');
    //修改价格
    $route->any('mall/order/edit/price', 'MallOrderController@editPrice');
    //退款
    $route->any('mall/apply/refund', 'MallOrderController@apply_refund');
    //发货
    $route->any('mall/deliver', 'MallOrderController@deliver');
    //快递公司列表
    $route->any('mall/express/type', 'ExpressController@expressType');
    //物流详情
    $route->any('mall/express/index', 'ExpressController@index');
    //修改物流
    $route->any('mall/express/store', 'ExpressController@store');

    //comment
    $route->any('mall/order/comment', 'OrderCommentController@index');
    $route->any('mall/order/comment/destroy', 'OrderCommentController@destroy');
    $route->any('mall/order/comment/reply', 'OrderCommentController@reply');


    #========== 资金 ==========
    $route->any('fund/trade/index', 'FundController@index');
    $route->any('fund/refund', 'FundController@refund');
    $route->any('fund/commission', 'FundController@commission');



    # ============================= api ===================================
    $route->any('producer/ads/index', 'ProducerAdsController@index');
    $route->any('producer/ads/info', 'ProducerAdsController@info');
    $route->any('producer/ads/destroy', 'ProducerAdsController@destroy');

    //已报名列表
    $route->any('adv/sign/up/list', 'SignUpController@index');
    $route->any('adv/order/info', 'SignUpController@order_info');
    $route->any('adv/order/remark', 'SignUpController@remark');
    $route->any('adv/order/amount', 'SignUpController@amount');

    //邀请
    $route->any('adv/invite/index', 'AdvInviteController@index');

    //banner
    $route->get('banner/index', 'BannerController@index')->name('admin.banner.index');
    $route->get('banner/info', 'BannerController@info')->name('admin.banner.info');
    $route->post('banner/store', 'BannerController@store')->name('admin.banner.store');
    $route->post('banner/destroy', 'BannerController@destroy')->name('admin.banner.destroy');

    //problem
    $route->get('problem/index', 'ProblemController@index');
    $route->get('problem/info', 'ProblemController@info');
    $route->post('problem/store', 'ProblemController@store');
    $route->post('problem/destroy', 'ProblemController@destroy');
    $route->post('problem/edit/status', 'ProblemController@editStatus');

    //转连
    $route->any('link/index', 'LinkController@index');

    //达人套餐设置
    $route->post('daren/setting/store', 'ConfigController@store_daren_amount');

    //零元购
    $route->get('zero/index', 'ZeroProductController@index');
    $route->post('zero/store', 'ZeroProductController@store');
    $route->post('zero/destroy', 'ZeroProductController@destroy');

});


